<template>
	<div class="yzm">
		<div class="yzmone">
			<div class="yzmone-top">
				<img  src="../../../../public/grzx/show-3.png"/>
				<h2>账号密码登录</h2>
			</div>
		</div>
		<div class="yzmtwo">
			<input type="text" placeholder="请输入手机号/邮箱" v-model="email" @change="changeCl(this.email)"/>
			<br />
			<input type="password" placeholder="请输入密码" v-model="yzm"/>
		</div>
		<div class="yzmthree">
			<input type="button" value="登录" :class="{'default':show}" @click="Spring()"/>
			<div class="yzmthree-bottom">
				<p @click="btn2()">忘记密码</p>
				<label>验证码登录</label>
			</div>
		</div>
		<div class="yzmfour">
			<img src="../../../../public/grzx/show-2.png" />
			<img src="../../../../public/grzx/show-1.png" />
		</div>
		<div class="yzmfive">
			<input type="radio"/><em>未注册游侠客账号的手机，登录时将同时注册，登录代表您已</em>
			<p>同意<span>《同意协议》</span>和<span>《隐私政策》</span></p>
		</div>
	</div>
</template>

<script>
	
	import Cookies from 'js-cookie'
	
	import {mapState,mapMutations} from 'vuex'
	export default{
		name:'Yzmone',
		data(){
			return{
				email:'',
				yzm:'',
				show:false
			}
		},
		computed:{
					...mapState(['cname'])
				},
		methods:{
			btn2(){
				this.$router.push('/forget')
			},
			Spring(){
				if (this.email!=''&&this.yzm!='') {
					if (this.email==1242881417) {
						if (this.yzm==123456) {
							Cookies.set('demo_uname',this.email)
							this.$router.push("/orderlist")
						}
					}
				}
			},
			changeCl(val){
				this.update(val)
					if (this.email!='') {
						this.show=true
					}else{
						this.show=false
					}
				},
				...mapMutations(['update']),
		}
	}
</script>

<style scoped>
	.yzmone{
		position: relative;
		width: 100%;
		height: 3.5rem;
	}
	.yzmone  .yzmone-top{
		width: 90%;
		height: 3.5rem;
		margin: 0 auto;
		text-align: center;
	}
	.yzmone .yzmone-top img{
		width: 2rem;
		height: 2rem;
	}
	.yzmone .yzmone-top h2{
		font-size: 0.45rem;
		font-weight: bold;
		padding-bottom: 0.3rem;
	}
	.yzmtwo{
		position: relative;
		width: 100%;
		height: 3.5rem;
		text-align: center;
	}
	.yzmtwo input:nth-child(1){
		width: 90%;
		height: 0.8rem;
		margin: 0.5rem 0;
		background-color: rgba(241,241,241,.3);
		border: none;
		border-radius: 0.1rem;
		padding: 0.2rem 0.2rem;
		font-size: 0.35rem;
		outline: none;
	}
	.yzmtwo input:nth-child(3){
		width: 90%;
		height: 0.8rem;
		background-color: rgba(241,241,241,.3);
		border: none;
		border-radius: 0.1rem;
		padding: 0.2rem 0.2rem;
		font-size: 0.35rem;
		outline: none;
	}
	.yzmthree{
		width: 100%;
		height: 2.4rem;
		text-align: center;
	}
	.yzmthree input{
		width: 90%;
		margin: 0.2rem 0;
		height: 1.3rem;
		font-size: 0.4rem;
		border: none;
		border-radius: 0.1rem;
		background-color: #fff6cc;
		color: gray
	}
	.yzmthree .default{
		background: linear-gradient(#ffed5c,#ffce06);
	}
	.yzmthree .yzmthree-bottom{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.yzmthree .yzmthree-bottom p{
		padding: 0.15rem 0.8rem;
		font-size: 0.35rem;
		color: gray
	}
	.yzmthree .yzmthree-bottom label{
		padding: 0.15rem 0.8rem;
		font-size: 0.35rem;
		color: gray
	}
	.yzmfour{
		width: 100%;
		height: 3.6rem;
		text-align: center;
		line-height: 5rem;
	}
	.yzmfour img{
		width: 1rem;
		height: 1rem;
		margin: 0 1.5rem;
	}
	.yzmfive{
		width: 100%;
		height: 1.2rem;
	}
	.yzmfive input{
		margin: 0.1rem 0 0 0.7rem;
		width: 0.25rem;
		height: 0.25rem;
	}
	.yzmfive em{
		font-size: 0.3rem;
		color: gray
	}
	.yzmfive p{
		padding: 0.15rem 0 0 0.7rem;
		color: gray
	}
	.yzmfive p span{
		color: #000000;
	}
</style>
